//猴子分桃
#include <iostream>
using namespace std;
#include <math.h>
int main() {
    int n;
    while (cin >> n) { // 注意 while 处理多个 case
        if(n==0)
        break;
        long sum,left;
        left=pow(4,n)+n-4;
        sum=pow(5,n)-4;
        cout<<sum<<" "<<left<<endl;
    }
    return 0;
}

//反转部分单链表
     ListNode*Reversendoe(ListNode*rhead)
     {
        ListNode*cur=rhead;
        ListNode*prev=nullptr;
        while(cur)
        {
             ListNode*next=cur->next;
             cur->next=prev;
             prev=cur;
             cur=next;
        }
        return prev;
     }
    ListNode* reverseBetween(ListNode* head, int m, int n) {
        // write code here
        ListNode *phead=new ListNode(0);
        phead->next=head;
        ListNode*prevnode=phead,*rhead=nullptr,*rtail=nullptr,*next=nullptr;
        for(int i=0;i<m-1;++i)
        prevnode=prevnode->next;
        rhead=prevnode->next;
        rtail=rhead;
        for(int i=0;i<m-n;i++)
        {
            rtail=rtail->next;
        }
        next=rtail->next;
        rtail->next=nullptr;
        ListNode*newhead= Reversendoe(rhead);
        prevnode->next=newhead;
        rhead->next=next;
        ListNode*list=phead->next;
        delete phead;
        return list;
    }
};